<%_ if (app.prodDatabaseTypeMysql) { _%>
mysql:
  enabled: true
  mysqlDatabase: <%= app.baseName.toLowerCase() %>
  mysqlAllowEmptyPassword: true
  <%_ if (istio) { _%>
  podAnnotations:
    sidecar.istio.io/inject: "false"
  <%_ } _%>
  initializationFiles:
    grant.sql: |-
      grant all privileges on *.* to root@'%' identified by '' with grant option;
<%_ } else if (app.prodDatabaseTypePostgresql) { _%>
postgresql:
  enabled: true
  postgresqlUsername: <%= app.baseName.toLowerCase() %>
  postgresqlDatabase: <%= app.baseName %>
  <%_ if (istio) { _%>
  master:
    podAnnotations:
      sidecar.istio.io/inject: "false"
  slave:
    podAnnotations:
      sidecar.istio.io/inject: "false"
  <%_ } _%>
<%_ } else if (app.prodDatabaseTypeMariadb) { _%>
mariadb:
  enabled: true
  replication:
    enabled: false
  db:
    name: <%= app.baseName.toLowerCase() %>
  <%_ if (istio) { _%>
  master:
    annotations:
      sidecar.istio.io/inject: "false"
  slave:
    annotations:
      sidecar.istio.io/inject: "false"
  <%_ } _%>
<%_ } else if (app.databaseTypeMongodb) { _%>
mongodb:
  enabled: true
mongodb-replicaset:
  replicas: 3
  <%_ if (istio) { _%>
  podAnnotations:
    sidecar.istio.io/inject: "false"
  <%_ } _%>
<%_ } else if (app.databaseTypeCouchbase) { _%>
couchbase-operator:
  enabled: true
  buckets:
    default: nil
    <%= app.baseName.toLowerCase() %>:
      replicas: <%= app.dbPeerCount - 1 %>
  users:
    <%= app.baseName.toLowerCase() %>:
      authSecret: couchbase-secret
      authDomain: local
      roles:
        - name: bucket_admin
          bucket: <%= app.baseName.toLowerCase() %>
        - name: bucket_full_access
          bucket: <%= app.baseName.toLowerCase() %>
        - name: fts_admin
          bucket: <%= app.baseName.toLowerCase() %>
        - name: fts_searcher
          bucket: <%= app.baseName.toLowerCase() %>
  cluster:
    antiAffinity: true
    image: <%- dockerContainers.couchbase %>
    security:
      adminSecret: couchbase-secret
    servers:
      default:
    <%_ if (kubernetesUseDynamicStorage) { _%>
        volumeMounts:
          default: pvc-default
          data: pvc-data
          index: pvc-index
    <%_ } _%>
        services:
          - data
          - query
          - index
          - search
        size: <%= app.dbPeerCount %>
    cluster:
      dataServiceMemoryQuota: 500Mi
      indexServiceMemoryQuota: 300Mi
      searchServiceMemoryQuota: 300Mi
      indexStorageSetting: plasma
      indexer:
        storageMode: plasma
    <%_ if (kubernetesUseDynamicStorage) { _%>
    volumeClaimTemplates:
      - metadata:
          name: pvc-default
        spec:
          storageClassName: <%= kubernetesStorageClassName %>
          resources:
            requests:
              storage: 1Gi
      - metadata:
          name: pvc-data
        spec:
          storageClassName: <%= kubernetesStorageClassName %>
          resources:
            requests:
              storage: 1Gi
      - metadata:
          name: pvc-index
        spec:
          storageClassName: <%= kubernetesStorageClassName %>
          resources:
            requests:
              storage: 1Gi
    <%_ } _%>
<%_ } _%>
